﻿namespace RuoVea.CodeGen.Server.Models;

/// <summary>
/// 元数据表
/// </summary>
[SugarTable(nameof(GenDbTableMetadata), "元数据表")]
public class GenDbTableMetadata : EntityBaseId
{ 
    /// <summary>
    /// 表名
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string TableName { get; set; }

    /// <summary>
    /// 实体名
    /// </summary>
    [SugarColumn(IsNullable = false)]
    public string ClassName { get; set; }

    /// <summary>
    /// 数据库
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public long DbId { get; set; }

    /// <summary>
    /// 表备注
    /// </summary>
    [SugarColumn(IsNullable = true)]
    public string Description { get; set; }

    /// <summary>
    /// 子项
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    [Navigate(NavigateType.OneToMany, nameof(GenFieldMetadata.TableMetaId))]
    public List<GenFieldMetadata>? Propertys { get; set; }

    /// <summary>
    /// 
    /// </summary>
    [SugarColumn(IsIgnore = true)]
    public string NameSpace { get; set; } = "RuoVeaApp";

}
